package edu.xlh.travel.controller.user;

import com.baomidou.mybatisplus.extension.api.R;
import edu.xlh.travel.common.Result;
import edu.xlh.travel.service.EmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("/email")
public class EmailController {
    @Autowired
    private EmailService emailService;

    @RequestMapping("/getRecentHotelEmail")
    @ResponseBody
    public Result getRecentHotelEmail( HttpSession session) {
        return emailService.getRecentHotelEmail(session);
    }

    @RequestMapping("/getRecentScenicEmail")
    @ResponseBody
    public Result getRecentScenicEmail(HttpSession session) {
        return emailService.getRecentScenicEmail(session);
    }

    @RequestMapping("/setIsRead")
    @ResponseBody
    public Result setIsRead(String id , HttpSession session) {
        return emailService.setIsRead(id , session);
    }
}
